package utils

type PageInfo struct {
	Offset int32
	Limit  int32
	Total  int64
}

//
// 构造pageInfo信息
//
func NewPageInfo(page int32, pageSize int32) *PageInfo {
	pageInfo := &PageInfo{
		Offset: page,
		Limit:  pageSize,
		Total:  0,
	}

	if pageInfo.Offset == 0 {
		pageInfo.Offset = 1
		pageInfo.Limit = 20
	}

	return pageInfo
}